<template>
  <div class="popup" v-if="value">
    <div class="popup-content" @click.stop>
      <div class="close-button">
        <i class="fas fa-times" @click="$emit('input', false)">x</i>
      </div>
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    value: Boolean
  },
};
</script>

<style scoped>
.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
}

.popup-content {
  background-color: white;
  padding: 20px;
  border-radius: 5px;
  position: relative;
  width: 80%;
  max-width: 500px;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
  color: #999;
  font-size: 20px;
}

.close-button:hover {
  color: #333;
}
</style>